import java.util.Scanner;

public class Text4 {
    public static void main(String[] args) {
        Scanner sca = new Scanner(System.in);
        int n = sca.nextInt();
        int sum = fun(n);
        System.out.println(sum);
    }
    public static int fun(int n){
        if(n <= 9){
            return n;
        }
        return n%10+fun(n/10);
    }
}
